home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 12 / BBS in a box XII-2.iso / Files II / Prog / B-C / C++ FAQ Reference 1.0.sit / C++ FAQ Reference 1.0.rsrc / TEXT_1330.txt < prev    next >
Encoding:
Text File  |  1993-06-30  |  928 b   |  3 lines

  1. Static (most say 'strong') typing says the compiler checks the type-safety of every operation *statically* (at compile-time), rather than to generate code which will check things at run-time.  For example, the signature matching of fn arguments is checked, and an improper match is flagged as an error by the *compiler*, not at run-time.
  2.  
  3. In OO code, the most common 'typing mismatch' is sending a message to an object that the recipient isn't prepare to handle.  Ex: if class 'X' has member fn f() but not g(), and 'x' is an instance of class X, then x.f() is legal and x.g() is illegal.  C++ (statically/strongly typed) catches the error at compile time, and Smalltalk (dynamically/weakly typed) catches 'type' errors at run-time. (Technically speaking, C++ is like Pascal [*pseudo* statically typed], since ptr casts and unions can be used to violate the typing system; you probably shouldn't use these constructs very much).